package com.zhiyou100.service.impl;

import com.zhiyou100.dao.StudentDao;
import com.zhiyou100.entity.Exam;
import com.zhiyou100.entity.Student;
import com.zhiyou100.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 学生服务实现类
 *
 * @author yang
 * @version 1.0.0
 * @date 2020-09-25 20:47
 */
@Service
public class StudentServiceImpl implements StudentService {
    private StudentDao dao;

    @Autowired
    public void setDao(StudentDao dao) {
        this.dao = dao;
    }

    @Override
    public void addOne(Student o) {
        dao.addOne(o);
    }

    @Override
    public void deleteOne(Integer integer) {
        dao.deleteOne(integer);
    }

    @Override
    public void updateOne(Student o) {
        dao.updateOne(o);
    }

    @Override
    public List<Student> getAll() {
        return dao.getAll();
    }

    @Override
    public Student getOne(Integer integer) {
        return dao.getOne(integer);
    }

    @Override
    public Student selectOneByName(String name) {
        return dao.selectOneByName(name);
    }

    @Override
    public Student selectOneByIdAndPwd(Integer id, String pwd) {
        return dao.selectOneByIdAndPwd(id, pwd);
    }

    @Override
    public Student selectOneByField(String field, Object value) {
        return dao.selectOneByField(field, value);
    }
}
